<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加新评论</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <style>
        body{
            left: 50%;
            top: 50%;
            transform: translate(100%,50%);
            max-width: 500px;
        }
    </style>
</head>

<body>
    <form action="/postInputData" id="fom" method="POST" class="form-horizontal">
        <div class="form-group">
            <label for="name">用户名：</label>
            <input class="form-control" type="text" id="name" name="name" placeholder="输入你的用户名" autocomplete="off">
        </div>
        <div class="form-group">
            <label for="con">你的评论：</label>
            <textarea name="con" class="form-control" id="con" cols="30" rows="10" placeholder="输入你的评论"></textarea>
        </div>
        <button class="btn btn-success center-block">提交</button>
    </form>

</body>
<script src="jquery/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<!-- <script>
    $("button").on("click", function (e) {
        e.preventDefault();
        let myDate = new Date;
        let year = myDate.getFullYear();
        let mon = myDate.getMonth() + 1; //获取当前月
        let date = myDate.getDate();
        let hour = myDate.getHours();
        let minutes = myDate.getMinutes();
        let timestr = year + '/' + mon + '/' + date + ' ' + hour + '/' + minutes;
        $.ajax({
            url: "http://localhost:8081/pos",
            method: 'post',
            dataType: 'json',
            data: {
                name: $("input[name='name']").val(),
                con: $("textarea[name='con']").val(),
                time: timestr
            },
            success: function (e) {
                if(e.code  == 200){
                    window.location.href = "E:/布卡/MyCode/NodeJs/day04/views/index.html";
                }
            }
        })
    })
</script> -->
</html>